package com.huawei.statistics.dao.common;

import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * Created by 许湛司 on 2017/4/21.
 */
@Mapper
public interface IBaseDao {
    /**
     * 新增
     *
     * @throws Exception
     */
    int insert(Map<String, Object> param);

    /**
     * 批量新增
     *
     * @throws Exception
     */
    int batchInsert(Map<String, Object> param) throws Exception;


    /**
     * 删除
     *
     * @param param
     * @return
     */
    int delete(Map<String, Object> param);

    /**
     * 批量删除
     *
     * @param param
     * @return
     */
    int batchDelete(Map<String, Object> param);

    /**
     * 更新
     *
     * @throws Exception
     */
    int update(Map<String, Object> param) throws Exception;

    /**
     * 查询
     *
     * @param param
     * @return
     */
    List<Map<String, Object>> select(Map<String, Object> param);

    /**
     * 查询返回map
     *
     * @param param
     * @return
     */
    Map<String, Object> selectByMap(Map<String, Object> param);


    /**
     * 根据查询条件找到数量
     */
    int getCount(Map<String, Object> condition);

    /**
     * 根据查询条件找到
     *
     * @param condition
     * @return
     */
    Integer getSum(Map<String, Object> condition);

    /**
     * 分页获取实体
     *
     * @param params
     * @return
     */
    List<Map<String, Object>> findEntitiesByPage(Map<String, Object> params);
}
